<?php
/**
 * ClassName: RecuperateService
 * Description: 调理记录Service
 * @Author 周昌
 * @Create 2023/12/19 15:28
 */

namespace service\admin;


use model\CasesModel;
use service\BaseService;

class RecuperateService extends BaseService
{
    protected static $model='model\RecuperateModel';

    //添加、编辑
    public static function addEdit($case_id,$data)
    {
        $res=self::$model::getInfo(['case_id'=>$case_id]);
        $caseInfo=CasesModel::getInfo(['id'=>$case_id],'id as case_id,archives_id,hospital_id');
        $data=array_merge($caseInfo,$data);
        if($res){
            $res=self::edit($res['id'],$data);
        }else{
            $res=self::add($data);
        }
        return $res;


    }


}